<?php
/**
 * Класс Field_Marker
 *  @author Mike
 */

class FieldMarker extends ActiveRecord {
	protected $tableName = 'field_marker';
	protected $pkName = 'ID_field_marker';
	protected $arrSettings = array('created_at' => true, 'author' => true);
	protected $fieldsRules = array (
								'description' => array('min' => 1, 'max' => 1024)
							);
	
	public static function getMarkers($cityId) {
		$objDB = Service_Database::instanse();
		$stmt = "SELECT `field_marker`.`ID_field_marker`,`field_marker`.`latitude`,`field_marker`.`longitude`,`field_marker`.`description`,`field_marker`.`cost`,`field_marker`.`type` FROM `field_marker` WHERE `field_marker`.`ID_city`='" . $cityId . "'";
		return $objDB->select($stmt);
	}
}

?>